#include <iostream>

using namespace std;

int main()
{
    freopen("008.in", "r", stdin);
    freopen("008.out", "w", stdout);
    char c;
    int a[1001];
    int i=0, res = -1;
    
    for (;(c = getchar()) != EOF;) 
    {  
        if (c == '\n') continue;
        a[i++] = c-48;
    }
    cout << i << endl;
    for (int j = 0; j < i; j++) cout << a[j];
    
    for (int j = 0; j <= i-5; j++)
    {
        int pro = 1;
        for (int k = j; k <= j+4; k++) 
        {
            pro *= a[k];
            cout << a[k] << " ";
        }
        cout << pro << endl;
        if (pro > res) res = pro;
    }
    cout << res << endl;
    
    return 0;
}
